package com.linser.gistools.refactoring.geotools.layer;

import org.geotools.data.FeatureSource;
import org.geotools.feature.FeatureCollection;
import org.geotools.map.FeatureLayer;
import org.geotools.styling.Style;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: linser
 * @Desc: 自定义FeatureLayer
 * @create: 2024-03-10 21:32
 **/
public class FeatureLayerNew extends FeatureLayer {
    private Map<String, Object> customData;

    public FeatureLayerNew(FeatureSource featureSource, Style style) {
        super(featureSource, style);
    }

    public FeatureLayerNew(FeatureSource featureSource, Style style, String title) {
        super(featureSource,style, title);
    }

    public FeatureLayerNew(FeatureCollection collection, Style style) {
        super(collection,style);
    }

    public FeatureLayerNew(FeatureCollection collection, Style style, String title) {
        super(collection,style, title);
    }

    public FeatureLayerNew(FeatureCollection collection, Style style, String title,Map<String, Object> customData) {
        super(collection,style, title);
        this.customData = customData;
    }

    public void setCustomData(Map<String, Object> customData) {
        this.customData = customData != null ?customData:new HashMap<>();
    }

    public Map<String, Object> getCustomData() {
        return this.customData;
    }
}
